#ifndef WAVEFORMWIDGET_H
#define WAVEFORMWIDGET_H

#include <QWidget>
#include <QVector>
#include <QPainter>
#include <QDebug>

class WaveformWidget : public QWidget
{
    Q_OBJECT
public:
    explicit WaveformWidget(QWidget *parent = nullptr);
    void setAudioSamples(const QVector<qint16> &samples, int toNum);

protected:
    void paintEvent(QPaintEvent *event) override;

private:
    QVector<qint16> audioSamples; // 绘图数据
    int m_toNum = 0;              // 和标准1s差的数据量

signals:
};

#endif // WAVEFORMWIDGET_H
